package projetoesa;



import java.util.ArrayList;
import projetoesa.Disciplina;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Heitor
 */
public class CadastroDisciplina {

    ArrayList<Disciplina> disciplina = new ArrayList<Disciplina>();

    public void addDisciplina(Disciplina disc) {
        this.disciplina.add(disc);
    }

    public void removeDisciplina(String nome) {
        for (int j = 0; j < this.disciplina.size(); j++) {
            if (nome.equals(disciplina.get(j).getNome())) {
                disciplina.remove(j);
            }
        }
    }

    public Disciplina buscarDisciplina(String nome) {

        for (int i = 0; i < disciplina.size(); i++) {
            if (disciplina.get(i).getNome().equals(nome)) {
                return disciplina.get(i);
            }
        }
        return null;
    }
}
